/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: 17655
 * Date: 2025-07-31
 * Time: 22:15
 */
public class test3 {
    public test1.TreeNode invertTree(test1.TreeNode root) {
        if (root==null){
            return null;
        }
        test1.TreeNode tmp = root.left;
        root.left = root.right;
        root.right = tmp;
        invertTree(root.left);
        invertTree(root.right);
        return root;
    }
}
